package com.atguigu.day05;

public class Test08 {
    public static void main(String[] args) {
        char[] ans = new char[]{'A', 'D', 'B', 'C', 'D'};
        char[] s = new char[]{'D', 'C', 'B', 'A', 'D'};
        char[] g1 = new char[]{'A', 'D', 'B', 'C', 'D'};
        char[] g2 = new char[]{'A', 'D', 'B', 'C', 'A'};
        char[] h = new char[]{'A', 'B', 'C', 'D', 'D'};
        System.out.println("满分10分,小尚:得分" + comp(ans, s));
        System.out.println("满分10分,小硅:得分" + comp(ans, g1));
        System.out.println("满分10分,小谷:得分" + comp(ans, g2));
        System.out.println("满分10分,小好:得分" + comp(ans, h));
    }

    static int comp(char[] ch1, char[] ch2) {
        int score = 0;
        for (int i = 0; i < ch1.length; i++) {
            if (ch1[i] == ch2[i]) {
                score += 2;
            }
        }
        return score;
    }
}
